﻿<html>
	<head>
		<title></title>
	</head>
	<body>
		<script type="application/javascript">
			function imprimirTicket(){
				var out = "<?xml version=\"1.0\"?>\n"
				out += "<methodCall>\n"
				out += "<methodName>ticket</methodName>\n"
				//out += "<params>\n"
				//out += "<param>\n<value>\n<string>a</string>\n</value>\n</param>\n" For send data to ticket... TODO
				//out += "</params>\n"
				out += "</methodCall>\n"
				
				var xhr = new XMLHttpRequest()
				xhr.open("POST", "http://localhost:8000/POS", true)
				xhr.send(out)
				xhr.onreadystatechange = function() {
					if (xhr.readyState == 4){
						console.log('imprimiendo')
					}
				}
				
			}
			function abrirCajon(){
				var out = "<?xml version=\"1.0\"?>\n"
				out += "<methodCall>\n"
				out += "<methodName>open</methodName>\n"
				out += "</methodCall>\n"
				
				var xhr = new XMLHttpRequest()
				xhr.open("POST", "http://localhost:8000/POS", true)
				xhr.send(out)
				xhr.onreadystatechange = function() {
					if (xhr.readyState == 4){
						console.log('abierto')
					}
				}	
			}
		</script>
		
		<button onclick="imprimir()">Imprimir</button>
		
	</body>
</html>